Computer programming languages have been developing rapidly over the years. Many programs today not only include functions or routines, but also include nested functions or subroutines (i.e. sub-functions). In computer programming, a subroutine is a sequence of program instructions that perform a specific task, packaged as a unit. This unit can then be used in programs wherever that particular task should be performed. Subroutines may be defined within programs, or separately in libraries that can be used by multiple programs. In different programming languages a subroutine may be called a procedure, a function, a routine, a method, or a subprogram. The generic term callable unit is sometimes used.
A subroutine is similar to a computer program that is used as one step in a larger program or another subprogram. A subroutine may be coded so that it can be started (i.e. called) several times from several places during one execution of the program, including from other subroutines, and then branch back (i.e. return) to the next instruction after the call once the subroutine's task is done. Subroutines may reduce the cost of developing and maintaining a large program, while increasing its quality and reliability.
However, error detection in subroutines may be very difficult during software or hardware test execution or customer problem recreation. Usually, by the time an error is detected, storage areas with pertinent information for diagnosis of the error may be overwritten, causing loss of pertinent information. Therefore, it may be advantageous, among other things, to provide earlier and better problem documentation.